//**********************************************
///  ,   ..         .
//   ,        ,    (java).
//  ,      Shift +   
//**********************************************
var
Bypass: String;
ObjectID, ActionID, Status: Integer;

const
HTML='<html><body><center><img src="L2UI_CH3.herotower_deco"'+
' width=256 height=32><font color="LEVEL">  '+
'  </font><br><font color="LEVEL">: Furio'+
'us</font><img src="L2UI.SquareWhite" width=260 height=1><im'+
'g src="L2UI.SquareBlank" width=260 height=4><br1><td><butto'+
'n value="" action="bypass -h open" width=70 height=1'+
'5 back="sek.cbui94" fore="sek.cbui92"></td><br><td><button '+
'value="" action="bypass -h close" width=70 height=15'+
' back="sek.cbui94" fore="sek.cbui92"></td><br></tr><img src'+
'="L2UI.SquareWhite" width=260 height=1><img src="L2UI.Squar'+
'eBlank" width=260 height=4><br1></center></body></html>';

procedure ShowHTML;
  begin
    buf:=#$0F;
    WriteD(5);
    WriteS(HTML);
    SendToClient;
  end;

procedure DoorAction;
  begin
    buf:=#$4D;
    WriteD(ObjectID);
    WriteD(Status);
    WriteD(0);
    WriteD(1);
    WriteD(0);
    SendToClient;
  end;


begin
  if FromClient and (pck[1]=#$04) then
    begin
      ActionID:=ReadC(18);
      if ActionID=1 then
        begin
          ObjectID:=ReadD(2);
          ShowHTML;
        end;
    end;
  if FromClient and (pck[1]=#$21) then
    begin
      Bypass:=ReadS(2);
      case Bypass of
      'open':Status:=0 and DoorAction;
      'close':Status:=1 and DoorAction;
      end;
    end;
end.
